package com.java.pattern.singleton.hungry;

/**
 * @author ：xuelei
 * @date ：Created in 2021/10/21 14:34
 * @description：饿汉式之静态代码块
 * @modified By：
 * @version: $
 */
public class Demo2 {

    private Demo2(){}

    private static Demo2 instance;
    //静态代码块
    static {
        instance = new Demo2();
    }

    public static Demo2 getInstance(){
        return instance;
    }

}
